<ui:composition template="/template/twocolumn2.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:define name="conteudo">
    	<div id="form_style">
    	 <div class="cadastro">
				<h3>Cadastro de Professor</h3>
	            <h:form id="form" enctype="multipart/form-data">
	            <f:event listener="#{professorMB.inicializa}" type="preRenderView" />
	            <p:messages id="messages" showDetail="false" autoUpdate="true" closable="true" globalOnly="true"/>  
	            <h:panelGrid id="pgcadastro" columns="3">
	                <h:outputLabel id="lNome" value="#{Message['label.usuario.nome']}:" />
	                <h:inputText id="nome" value="#{professorMB.professor.nome}" autofocus="true"/>
	                <h:message for="nome" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lcpf" value="#{Message['label.usuario.cpf']}:" />
	                <h:inputText id="cpf" value="#{professorMB.professor.cpf}"  />
	                <h:message for="cpf" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lemail" value="#{Message['label.usuario.email']}:" />
	                <h:inputText id="email" value="#{professorMB.professor.email}" type="email" placeholder="aluno@email.com" />
	                <h:message for="email" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lsenha" value="#{Message['label.usuario.senha']}:" />
	                <h:inputText id="senha" value="#{professorMB.senha}" />
	                <h:message for="senha" errorStyle="color:red"/>
	                
	                <h:outputLabel id="ltelefona" value="#{Message['label.usuario.telefone']}:" />
	                <h:inputText id="telefone" value="#{professorMB.professor.telefone}" type="tel" placeholder="99 9999-9999" />
	                <h:message for="telefone" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lendereco" value="#{Message['label.usuario.endereco']}:" />
	                <h:inputText id="endereco" value="#{professorMB.professor.endereco}" />
	                <h:message for="endereco" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lcidade" value="#{Message['label.usuario.cidade']}:" />
	                <h:inputText id="cidade" value="#{professorMB.professor.cidade}" />
	                <h:message for="cidade" errorStyle="color:red"/>
	                
	                <h:outputLabel id="luf" value="#{Message['label.usuario.uf']}:" />
	                <h:selectOneMenu style="width:100%" id="uf" value="#{professorMB.uf}">
	                <f:selectItem itemLabel="-- Selecione --" noSelectionOption="true"/>
	                <f:selectItems value="#{professorMB.ufItens}" var="uf" 
	                itemLabel="#{uf.valor}" itemValue="#{uf.valor}"/>
	                </h:selectOneMenu>
	                <h:message for="uf" errorStyle="color:red"/>
	                
	                <h:outputLabel  id="lStatus" value="#{Message['label.usuario.status']}:" />
	                <h:selectOneMenu style="width:100%" id="status" value="#{professorMB.statusUsuario}">
	                <f:selectItem itemLabel="-- Selecione --" noSelectionOption="true"/>
	                <f:selectItems value="#{professorMB.statusItens}" var="status"
	                itemLabel="#{status.valor}" itemValue="#{status.chave}" />
	                </h:selectOneMenu>  
	                <h:message for="status" errorStyle="color:red"/>
	                
	                <h:outputLabel id="lAvatar" value="#{Message['label.usuario.avatar']}:" />
	                <p:fileUpload id="logo" value="#{professorMB.file}" mode="simple" update="alert" sizeLimit="10000000" 
	                    allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
	                <h:message for="logo" errorStyle="color:red"/>
	                    
	                
	        </h:panelGrid>
	        		<p:toolbar>  
                        <p:toolbarGroup align="left">  
						<p:commandButton value="Salvar" action="#{professorMB.adcionarProfessor}" ajax="false" icon="ui-icon-check" validateClient="true"  />
						<p:commandButton value="Cancelar" action="#{professorMB.cancelar}" immediate="true" ajax="false" icon="ui-icon-cancel"  />
						<p:commandButton value="Limpar" type="reset" ajax="false" icon="ui-icon-clear"  />
						</p:toolbarGroup>
					</p:toolbar>
	            </h:form>
	        </div>
	    </div>
    </ui:define>

</ui:composition>